package com.taotao.wechat.game;

import com.taotao.admin.MyRopClient;
import com.taotao.wechat.message.resp.Article;
import com.taotao.wechat.message.resp.BaseMessage;
import com.taotao.wechat.message.resp.NewsMessage;
import com.taotao.wechat.util.MessageUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 新春找4G，全民来挑战
 * 翻牌游戏一：2015年1月1日-2月3日
 * 规则：
 * 输入【找4G】关键词，再根据系统提示输入【内蒙古移动手机号码】，点击进入游戏页面就可参与活动；
 * 活动采用排名获奖制（如游戏分数相同，将按照时间顺序进行排名）；
 * 参与游戏次数不限，用户游戏分数排名，以活动期间最高一次分数进行记录；
 * 游戏起始时间为40秒（如下载【手机营业厅】客户端获取【时间代码】后，时间将延长至60秒）
 */
public class FindWordGame1 extends Game {
    public static boolean IS_ENABLE = true;
    private static final String game_url_format = "/game/findWord/index.html?appId=%s&openId=%s&tel=%s";

    public FindWordGame1(){}

    public FindWordGame1(BaseMessage baseMessage, String content, String appKey) {
        super(baseMessage, content, appKey);
    }

    @Override
    protected String gameUrl() {
        String url = MyRopClient.BASE_URL + String.format(game_url_format, appKey, baseMessage.getToUserName(), content);
        NewsMessage newsMessage = new NewsMessage(baseMessage);
        newsMessage.setMsgType(MessageUtil.RESP_MESSAGE_TYPE_NEWS);
        newsMessage.setArticleCount(1);
        Article article = new Article();
        article.setDescription("1月1日—2月3日，内蒙古移动用户可通过各分公司公众号参与本活动。在规定的时间内，根据找到的”4G”数量进行排名，并奖励相应的话费。PS：下载“手机营业厅”客户端获取时间码可延长游戏时间，中奖几率加倍哦！");
        article.setPicUrl(MyRopClient.BASE_URL + "/game/findWord/img/zt.jpg");
        article.setTitle("新春找4G，全民抢话费");
        article.setUrl(url);
        List<Article> articles = new ArrayList<Article>();
        articles.add(article);
        newsMessage.setArticles(articles);
        return MessageUtil.newsMessageToXml(newsMessage);
    }

    @Override
    public String wechatJoinCountToday(String openId, String appKey) {
        if("oANkGuDBj8L6nvvMmgt4b-YhR9-w".equalsIgnoreCase(openId)
                || "oANkGuPhWUYlvgPGNjPeeyxOqvP8".equalsIgnoreCase(openId)
                || "oANkGuG_uH-rFInDpqiAWIYs-BLc".equalsIgnoreCase(openId)
                || "oANkGuLf9auc11_NC-fVRdcoM3Hc".equalsIgnoreCase(openId)
                || "oANkGuNfnGVns4Vgr7HemLtcGbAE".equalsIgnoreCase(openId)
                || "oANkGuNUD8LMjrpSH1Vq8rsJtL34".equalsIgnoreCase(openId)
                || "oANkGuKYuXoVuk-r4WCikqQPNiFo".equalsIgnoreCase(openId)
                || "oANkGuJrQbUS-Qfp4KAlkLpoCDrU".equalsIgnoreCase(openId)
                || "oANkGuIcIxhCp6ZYFMvsvcLqZ9PU".equalsIgnoreCase(openId)
                || "oANkGuOBw_jg1nEspTiI960a_ZFs".equalsIgnoreCase(openId)
                || "oANkGuKpelg9Cgs1wYvKAnoVQ7as".equalsIgnoreCase(openId)
                || "oANkGuLQPriSIZMM57OUElPRb4H8".equalsIgnoreCase(openId)
                || "oANkGuLQkaJFcweg6r_oi6bJS0Ss".equalsIgnoreCase(openId)
                || "oANkGuPcbF1RzCSwBBc_yJOrp7jc".equalsIgnoreCase(openId)
                || "oANkGuFlLQ2UXCeIBoX3muwh4H9E".equalsIgnoreCase(openId)
                || "oANkGuMoBBFB3Xm8RxzzxKsMlXkg".equalsIgnoreCase(openId)
                || "oANkGuIguYuA9lKdWNvmJClX8BD4".equalsIgnoreCase(openId)
                || "oANkGuPyQ7P2WNYUObeMaC_jDbt4".equalsIgnoreCase(openId)
                || "oANkGuJXFZW2Cfq55l_ALBfWOJkA".equalsIgnoreCase(openId)
                || "oANkGuE2Q-NO9rwQof6Bzj661-64".equalsIgnoreCase(openId)
                || "oANkGuEPdQ8nVYZcBR3G7ftTh-Pg".equalsIgnoreCase(openId)
                || "oANkGuKg757WJN9vShrYrbt22CMI".equalsIgnoreCase(openId)
                || "oANkGuGs4ZM1dT0QdKmlki1XN3Qk".equalsIgnoreCase(openId)
                || "oANkGuFyo4rWO3_450OC6ryEyFPo".equalsIgnoreCase(openId)
                || "oANkGuENixKRGA4i7Cf_qahJ8Erc".equalsIgnoreCase(openId)
                || "oANkGuE82KwzwfQXABMPqhAUk7Po".equalsIgnoreCase(openId)
                || "oANkGuFj_FT2hx4qpG62CZrstT1I".equalsIgnoreCase(openId)
                || "oANkGuA75ysmpae5I5ngw-CZ8gls".equalsIgnoreCase(openId)
                || "oANkGuFQhFgxyqC-6TnyHIOgwm9g".equalsIgnoreCase(openId)
                || "oANkGuOtb0cjsmKQiqC4sXpgp2Ro".equalsIgnoreCase(openId)
                || "oANkGuJPWTaAvAVh3ljf02Wew3-o".equalsIgnoreCase(openId)
                || "oANkGuBOkgM_qATuG_6hJ-H6ZTdk".equalsIgnoreCase(openId)
                || "oANkGuO4ZDC1L1sf_lV2Oc2GDbd8".equalsIgnoreCase(openId)
                || "oANkGuASFLq0yMQ8QcPTstUBxZrg".equalsIgnoreCase(openId)
                || "oANkGuJQ8e1mrGEQpuLrjxVuGoNw".equalsIgnoreCase(openId)
                || "oANkGuCeNtuihM5igUzweejaIpEQ".equalsIgnoreCase(openId)
                || "oANkGuGNIPnGut5YMMQuKD-bVCWk".equalsIgnoreCase(openId)
                || "oANkGuCfh0NAtq5XndsE8Uxc7x9w".equalsIgnoreCase(openId)
                || "oANkGuHfLzFwDickWLXLmZ48K6Yw".equalsIgnoreCase(openId)
                || "oANkGuFvmF_4GCZ6zer516-5fkks".equalsIgnoreCase(openId)
                || "oANkGuFCoeyS0Lj6VdVcwoWS6iUE".equalsIgnoreCase(openId)
                || "oANkGuOEG_dRHPYltD7bDSZwM2IE".equalsIgnoreCase(openId)
                || "oANkGuKZL4T-Noo4D-bpic96Mu-I".equalsIgnoreCase(openId)) {
            return "因此微信号涉嫌恶意套取话费，已被取消参与资格";
        }
        return "";
    }

    @Override
    public boolean hasInputGameNameToday(String openId, String appKey) {
        return true;
    }

    @Override
    public String telJoinCountToday(String tel, String openId, String appKey) {
        return super.telJoinCountToday(tel, openId, appKey);
    }

    @Override
    public String getAppIds() {
        return "";
    }

    @Override
    public String getMemberCode() {
        return "4GPNGXN";
    }

    @Override
    public Integer getMemberStatus() {
        return 1;
    }

    @Override
    public String getName() {
        return "找4G";
    }

    @Override
    public String getNickName() {
        return "findWord1";
    }

    @Override
    public String getStartDate() {
        return "2015-01-01";
    }

    @Override
    public String getEndDate() {
        return "2015-02-04";
    }

    @Override
    public String getMsgUpgradeMemberSuccess() {
        return "恭喜您成功将游戏时长升级为60秒，祝您拿到更好排名";
    }

    @Override
    public String getMsgUpgradeMemberFailure() {
        return "很遗憾，升级失败，请核对【时间代码】";
    }

    @Override
    public String getMsgGameNotStart() {
        return "亲您也太心急了，我们的【找4G】游戏还没有开始呢！";
    }

    @Override
    public String getMsgGameIsEnd() {
        return "【找4G】活动已经结束。";
    }

    @Override
    public String getMsgAfterGameName() {
        return "请输入内蒙移动手机号码参与【找4G】游戏";
    }

    @Override
    public String getMsgTelWithoutGameName() {
        return "请先输入【找4G】关键词或点击【我要精彩】按键";
    }
}
